import request from "./request.js";

// 首页
export function indexApi(params) {
    return request({
        url: '/api/index/index',
        method: 'get',
        params
    })
}

// 注册接口
export function register(params) {
    return request({
        url: '/api/user/register',
        method: 'post',
        data: params
    })
}

// 注册获取验证码
export function emsSend(params) {
    return request({
        url: '/api/ems/send',
        method: 'post',
        data: params
    })
}

// 登录接口
export function login(params) {
    return request({
        url: '/api/user/login',
        method: 'post',
        data: params
    })
}
// 退出登录
export function logout(params) {
    return request({
        url: '/api/user/logout',
        method: 'post',
        data: params
    })
}
// 修改头像
export function profile(params) {
    return request({
        url: '/api/user/profile',
        method: 'post',
        data: params
    })
}
// 上传头像
export function upload(params) {
    return request({
        url: '/api/index/upload',
        method: 'post',
        data: params,
        headers: {
            'Content-Type': "multipart/form-data"
        }
    })
}

// 我的信息
export function mine(params) {
    return request({
        url: '/api/user/index',
        method: 'post',
        data: params
    })
}

// 修改登录密码
export function change(params) {
    return request({
        url: '/api/user/change',
        method: 'post',
        data: params
    })
}

// 充值列表
export function rechargeList(params) {
    return request({
        url: '/api/user/recharge_list',
        method: 'post',
        data: params
    })
}

// 店铺详情
export function shopInfo(params) {
    return request({
        url: '/api/index/shop_info',
        method: 'post',
        data: params
    })
}

// 入驻协议
export function merchantIndex(params) {
    return request({
        url: '/api/merchant/index',
        method: 'post',
        data: params
    })
}

// 商品
export function productList(params) {
    return request({
        url: '/api/index/pro',
        method: 'post',
        data: params
    })
}